//
//  FFNavigationController.swift
//  Clock
//
//  Created by jisa on 2020/5/7.
//  Copyright © 2020 jff. All rights reserved.
//

import UIKit

class FFNavigationController: UINavigationController, UINavigationControllerDelegate {
    
    var popDelegate: UIGestureRecognizerDelegate?
    override func viewDidLoad() {
        super.viewDidLoad()
        popDelegate = self.interactivePopGestureRecognizer?.delegate
        delegate = self
    }
    
    
    func navigationController(_ navigationController: UINavigationController, didShow viewController: UIViewController, animated: Bool) {
        if viewController == viewControllers[0] {
            self.interactivePopGestureRecognizer?.delegate = self.popDelegate
        } else {
            self.interactivePopGestureRecognizer!.delegate = nil
        }
    }
    
    override var shouldAutorotate: Bool {
        return super.shouldAutorotate
    }
    
    override var preferredInterfaceOrientationForPresentation: UIInterfaceOrientation {
        return super.preferredInterfaceOrientationForPresentation
    }
    
    override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
        return super.supportedInterfaceOrientations
    }
        
    

}
